<!doctype html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">
    <title>Iframely dev debug tool</title>
    <link rel="stylesheet" href="<%= CONFIG.baseStaticUrl %>/css/bootstrap.css" />
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/2.3.1/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="<%= CONFIG.baseStaticUrl %>/js/underscore-min.js"></script>
    <script type="text/javascript" src="<%= CONFIG.baseStaticUrl %>/js/debug.js"></script>
    <script type="text/javascript" src="<%= CONFIG.baseStaticUrl %>/js/iframely.js"></script>
    <script type="text/javascript">
        var baseAppUrl = <%- JSON.stringify(CONFIG.baseAppUrl) %>;
        var REL_GROUPS = <%- JSON.stringify(CONFIG.REL_GROUPS) %>;
        var DEBUG = <%= JSON.stringify(DEBUG) %>;
    </script>
</head>
<body>

<div class="container-fluid">
    <div class="row-fluid">
        <div class="span2">
            <p style="padding: 5px;">
                Feel free to contact <a href="mailto:ivan@iframely.com">ivan@iframely.com</a> with questions or feedback
            </p>
            <% if (DEBUG) { %>
            <p style="padding: 5px;">
                Bookmarklet:
                <a style="padding: 2px; border: solid grey 1px;" onclick="return false;" href="javascript: var win=window.open('<%- CONFIG.baseAppUrl %>/debug?uri='+encodeURIComponent(document.location.href),'_blank');win.focus();">debug&nbsp;in&nbsp;iframely</a>
                <br>
                You can drag&drop it to your bookmarks to test web pages quickly with iframely.
            <p>
            <!--
            <p style="padding: 5px;">
                <a href="/meta-mappings" target="_blank">Unified META mappings</a>
            <p>
            -->
            <% } %>
        </div>
        <div class="span10">

            <p>
                <form>
                    <div class="input-append">
                        <input class="input-xxlarge s-uri" type="url" value="<%= uri || '' %>" placeholder="Enter URL here" name="uri">
                        <input class="btn" type="submit" value="Debug!" />
                    </div>
                    <% if (DEBUG) { %>
                    <div class="control-group">
                        <div class="controls">
                            <label class="checkbox">
                                <input type="checkbox" name="mixAllWithDomainPlugin" <% if (mixAllWithDomainPlugin) { %>checked="checked"<% } %>> Debug with all plugins (disable specific mixins and mixin all available plugins) <a href="/debug?uri=<%= encodeURIComponent(uri) || '' %>&mixAllWithDomainPlugin=<%= !!!mixAllWithDomainPlugin %>" target="_blank">or open in new window with opposite value</a>
                            </label>
                            <label class="checkbox">
                                <input type="checkbox" name="refresh" <% if (disableCache) { %>checked="checked"<% } %>> Refresh</a>
                            </label>
                        </div>
                    </div>
                    <% } %>
                    <% if (DEBUG != CONFIG.DEBUG) { %>
                        <input type="hidden" name="debug" value="<%= DEBUG ? "true" : "false" %>">
                    <% } %>
                </form>
            </p>

            <div class="well" style="display: none;">
                API Call:
                <a target="_blank" id="api-uri"></a>
            </div>
            <div class="s-loader loader" style="display: none;">Loading...</div>
            <div class="alert" id="status" style="display: none;"></div>
            <div class="alert alert-info" id="errors" style="display: none;"></div>

            <div class="s-result-div" style="display: none;">
                <ul class="nav nav-tabs" id="myTab">
                    <li><a href="#1" data-toggle="tab" class="s-links">Links & Meta</a></li>
                    <li><a href="#4" data-toggle="tab" class="s-response-tab">JSON Response</a></li>
                    <li><a href="#2" data-toggle="tab" class="s-context-tab">Source Data</a></li>
                    <li><a href="#3" data-toggle="tab" class="s-all-debug">All debug data</a></li>
                </ul>

                <div class="tab-content">
                    <div class="tab-pane" id="1">
                        <div class="s-embeds"></div>
                    </div>
                    <div class="tab-pane" id="4">
                        <pre class="s-json"></pre>
                    </div>
                    <div class="tab-pane" id="2">
                        <div class="s-debug-context"></div>
                    </div>
                    <div class="tab-pane" id="3">
                        <pre class="s-debug-result"></pre>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>